home *** CD-ROM | disk | FTP | other *** search
/ Best Tools for JAVA / Best Tools for JAVA.iso / JAVA_ALL / IDE / SUBARTIC / SUB_ARCT / TEST / PANNER_T.JAV < prev    next >
Encoding:
Text File  |  1996-10-04  |  3.0 KB  |  95 lines

  1.  
  2. package sub_arctic.test;
  3.  
  4. /* import various pieces of the sub_arctic toolkit that we need */
  5. import sub_arctic.lib.*;
  6. import sub_arctic.input.*;
  7. import sub_arctic.constraints.std_function;
  8. import sub_arctic.constraints.std_constraint_consts;
  9.  
  10. public class panner_test extends debug_interactor_applet 
  11.   implements callback_object {
  12.  
  13.     /* need to reference this in the callback */
  14.     panner mypanner;
  15.   /* initialization of sub_arctic interface when applet starts */
  16.   public void build_ui(base_parent_interactor top) 
  17.     {
  18.       button b;
  19.       row r;
  20.       column c;
  21.       int_label l;
  22.  
  23.       l = new int_label();
  24.       l.set_pos(10,0);
  25.       l.set_part_a_constraint(std_function.eq(NEXT_SIBLING.PART_A()));
  26.       top.add_child(l);
  27.  
  28.       c = new column(30, column.CENTER_JUSTIFIED);
  29.       for (int i = 0; i<5; i++)
  30.     {
  31.       r = new row(30, row.CENTER_JUSTIFIED);
  32.       for (int j = 0; j<5; j++)
  33.         {
  34.           b = new button("PANNER TEST", this);
  35.           r.add_child(b);
  36.         }
  37.       c.add_child(r);
  38.     }
  39.  
  40.       mypanner = new panner(c);
  41.       mypanner.set_y_constraint(std_function.eq(PREV_SIBLING.Y2()));
  42.       mypanner.set_w_constraint(std_function.eq(PARENT.W()));
  43.       mypanner.set_h_constraint(std_function.
  44.                    subtract(PARENT.H(), PREV_SIBLING.H(), 0));
  45.       top.add_child(mypanner);
  46.  
  47.       l = new int_label();
  48.       l.set_pos(50,0);
  49.       l.set_part_a_constraint(std_function.eq(PREV_SIBLING.PART_B()));
  50.       top.add_child(l);
  51.  
  52.  
  53.       //      l = new int_label();
  54.       //      l.set_pos(10,0);
  55.       //      l.set_part_a_constraint(std_function.eq(NEXT_SIBLING.PART_A()));
  56.       //      top.add_child(l);
  57.       //      
  58.       //      parent_with_parts pwp = new parent_with_parts();
  59.       //      pwp.set_y_constraint(std_function.eq(PREV_SIBLING.Y2()));
  60.       //      pwp.set_w_constraint(std_function.eq(FIRST_CHILD.W()));
  61.       //      pwp.set_h_constraint(std_function.eq(FIRST_CHILD.H()));
  62.       //      pwp.set_part_a_constraint(std_function.eq(FIRST_CHILD.PART_A()));
  63.       //      top.add_child(pwp);
  64.       //      
  65.       //      h_scrollbar sb = new h_scrollbar(0,0,200,this);
  66.       //      pwp.add_child(sb);
  67.       //      
  68.     }
  69.  
  70.   /* handle callback from the button. */
  71.   public void callback(interactor from, event evt, int cb_num, Object cb_parm)
  72.     {
  73.       /* reset to zero if they push any button */
  74.       mypanner.set_x_view_coordinate(0);
  75.       mypanner.set_y_view_coordinate(0);
  76.     }
  77. };
  78.  
  79. /*=========================== COPYRIGHT NOTICE ===========================
  80.  
  81. This file is part of the subArctic user interface toolkit.
  82.  
  83. Copyright (c) 1996 Scott Hudson and Ian Smith
  84. All rights reserved.
  85.  
  86. The subArctic system is freely available for most uses under the terms
  87. and conditions described in 
  88.   http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html 
  89. and appearing in full in the lib/interactor.java source file.
  90.  
  91. The current release and additional information about this software can be 
  92. found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
  93.  
  94. ========================================================================*/
  95.